1. Field of the Invention
This invention relates to an image processing apparatus, which is used in a facsimile apparatus or the like, and in which an image of an original is read by an image sensor and is electrically processed.
2. Description of the Related Art
FIG. 8 is a block diagram of a conventional image processing apparatus. In this apparatus, a linear CCD (charge-coupled device) sensor is used as an image sensor.
In FIG. 8, a CCD sensor 2 converts the amount of light of a read image of an original into an electrical amount. A driver circuit 4 supplies a clock signal for driving the CCD sensor 2. An amplifier 6 amplifies the output of the CCD sensor 2 to an appropriate level. A sample-and-hold circuit 8 extracts only an output portion corresponding to the image of the original from a signal output from the CCD sensor 2 for each bit (pixel). A DC regeneration circuit 10 adjusts the level of an output representing a black portion of the image of the original in the signal subjected to sample-and-hold processing by the sample-and-hold circuit 8 so as to coincide with a bias voltage of a processing circuit. A peak-holding ABC (automatic background control) circuit 12 detects a peak value in the output of the DC regeneration circuit 10 during a reading operation for one line, in order to perform binary-coding processing of the image in consideration of the density of the background of the image of the original. The output signal of the CCD sensor 2 is non-uniform due to variations in its photosensitivity, and unbalance in a reading mechanism (such ununiformity is called "shading distortion"). A shading correction circuit 14 electrically corrects such shading distortion. An A/D converter 16 performs binary-coding processing of a video signal obtained after DC regeneration by the DC regeneration circuit 10 and outputs image data, using a reference signal provided by the peak-holding ABC circuit 12 and the shading correction circuit 14.
A reading control unit 18 controls timing of clock signals and control signals for the respective units. The reading control unit 18 also receives the image data subjected to binary-coding processing by the A/D converter 16, and performs image processing of the image data. The reading control unit 18 is controlled by an MPU (microprocessing unit) 19 for the entire system.
FIG. 9 illustrates the details of the peak-holding ABC circuit 12 and the shading correction circuit 14 shown in FIG. 8.
In FIG. 9, reference numeral 20 represents a portion corresponding to the peak-holding ABC circuit 12 shown in FIG. 8, and reference numeral 22 represents a portion corresponding to the shading correction circuit 14 shown in FIG. 8.
A video signal 24 is output from the DC regeneration circuit 10 shown in FIGS. 8,
Voltage-dividing resistors 26 and 28 divide the voltage of the input video signal 24. An analog switch 30 is closed within the range of ABC. A comparator 32 compares the input video signal with the present peak value. A charging resistor 34 is used for charging a peak-holding capacitor 38. An analog switch 36 is closed while the peak-holding capacitor 38 is charged. The peak-holding capacitor 38 holds the peak value of the video signal. A discharging resistor 40 is used for discharging the peak-holding capacitor 38. Reference numeral 42 represents a peak-value signal appearing in the peak-holding capacitor 38.
A buffer amplifier 44 buffers the peak-value signal 42. A charging resistor 45 is used for charging a shading capacitor 52. An analog switch 46 is closed while the shading capacitor 52 is charged. An analog switch 48 is closed while the shading capacitor 52 is discharged. An inverter 50 inverts a memory-read data signal 59. A discharging resistor 54 is used for discharging the shading capacitor 52.
A comparator 56 compares the video signal 24 with a reference signal 60. Reference numeral 57 represents a memory-writing data signal, which is data output from the comparator 56. A shading-data memory 58 stores shading-correction data. The memory-read data signal 59 is used for opening/closing the analog switches 46 and 48 in accordance with shading-correction data.
Reference numeral 60 represents a reference signal appearing at the shading capacitor 52, and is connected to a REF input terminal of the A/D converter 16 shown in FIG. 8.
Reference numeral 62 represents a control output signal from the reading control unit 18 shown in FIG. 8, which is an ABC-range signal for switching on the analog switch 30 within the range of ABC.
Reference numeral 64 represents a control output signal from the reading control unit 18 shown in FIG. 8, which is a memory control signal for controlling reading/writing operations for the shading-data memory 58.
An analog switch 66 switches an input signal to a (-)-input terminal of the comparator 32 between the peak-value signal 42 and the reference signal 60. Reference numeral 68 represents a control output signal from the reading control unit 18 shown in FIG. 8, which is a switching signal for switching the analog switch 66.
Next, a description will be provided of a reading operation in the apparatus shown in FIGS. 8 and 9. Before reading an image of a first original, in order to store a shading waveform for performing shading correction, a prescanning operation of reading a white background to be read (reference white background) provided within the apparatus by the CCD sensor 2 is performed.
That is, in FIG. 9, the analog switch 30 is closed in response to the ABC-range signal 62, whereby the video signal 24 is input to a (+)-input terminal of the comparator 32. Since the analog switch 66 is set to the side of the peak-value signal 42 in response to the switching signal 68, the held peak-value signal 42 is input to the (-)-input terminal of the comparator 32. If the video signal is greater than the peak-value signal as a result of comparison of the video signal 24 with the peak-value signal 42 by the comparator 32, the analog switch 36 is closed, whereby the peak-holding capacitor 38 is charged via the charging resistor 34 to increase the value of the peak-value signal 42. If the video signal is less than the peak-value signal, the analog switch 36 is kept open, and therefore the value of the peak-value signal 42 does not change. As a result, the value of the peak-value signal 42 coincides with the peak value of the video signal 24.
The peak-value signal 42 is transmitted to the following stage via the buffer amplifier 44. The comparator 56 compares the video signal 24 input to the (+)-input terminal with the reference signal 60 input to the (-)-input terminal. If the video signal is greater than the reference signal as a result of the comparison, the memory-writing data signal 57 becomes 1 (high). If the video signal is less than the reference signal, the memory-writing data signal 57 becomes 0 (low).
In the above-described prescanning operation, the output signal 57 of the comparator 56 is written in the shading-data memory 58, which simultaneously outputs the signal 57 as the memory-read data signal. If the memory-read data signal 57 assumes 1 (high), the analog switch 46 is closed and the analog switch 48 is opened, so that the peak-value signal 42 charges the shading capacitor 52 via the buffer amplifier 44 and the charging resistor 45. If the memory-read data signal assumes 0 (low), the analog switch 46 is opened and the analog switch 48 is closed, so that the shading capacitor 52 is discharged via the discharging resistor 54.
By repeating such charging/discharging of the shading capacitor 52, a waveform obtained by approximating the waveform of the video signal representing the current reading line with the charging-discharging of the shading capacitor 52 appears on the reference signal 60, and at the same time charging-discharging data (shading data) is stored in the shading-data memory 58.
In general, time is required for charging each peak value in the peak-holding capacitor 38. Hence, shading data is obtained by repeating the above-described operation for a few lines.
FIG. 10(A) is a diagram schematically illustrating an operation of obtaining a shading waveform shown in FIG. 10(B), which includes variations in the amount of light of a reading light source and in the sensitivity of the CCD sensor 2, by a prescanning operation of reading a reference white background to be read by the CCD sensor 20;
Thereafter, an operation of actually reading the original is performed.
The ABC-range signal 62 closes the analog switch 30 within the range of ABC for the width of the original. In the present embodiment, however, it is assumed that the width of the original is the range of ABC, and the analog switch 30 is closed while the original is read.
The original-reading video signal 24 reaches the (+)-input terminal of the comparator 32. While the original is read, the analog switch 66 is set to the side of the reference signal 60 in response to the switching signal 68, so that the reference signal 60 is input to the (-)-input terminal of the comparator 32. In the same manner as described above, by opening/closing the analog switch 36 in accordance with results of comparison between the video signal 24 and the reference signal 60, the reference signal 60 finally coincides with the video signal24.
The previously stored shading-correction data is read from the shading-data memory 58 in synchronization with each reading line in response to the memory control signal 64. The analog switches 46 and 48 are opened/closed in accordance with the shading-correction data comprising a value of 1 (high) or 0 (low), and the shading waveform obtained during the prescanning operation is reproduced in the reference signal 60 caused by charging/discharging of the shading capacitor 52.
The obtained reference signal 60 is input to the reference input terminal (REF) of the A/D converter 16 shown in FIG. 8, and the video signal 24 is input to an analog input terminal (V.sub.IN) Of the A/D converter 16, so that binary-coded image data subjected to shading correction is obtained and transmitted to the reading control unit 18.
Accordingly, in the case of an original having black portions "a" and "b" shown in FIG. 11(A), the reference signal and the video signal shown in FIG. 11(B) are obtained while the original is read. If 60% of the reference signal level is made a slice level in the reading control unit 18 shown in FIG. 8, the portions "a" and "b" are lower than the slice level, as shown in FIG. 11(C). Hence, the portions "a" and "b" are determined to be black portions.
By repeating the above-described operation for one line in the sub-scanning direction, reading for one page is performed.
In the above.-described processing in the conventional apparatus, storage and reproducing operations of the shading waveform will be described in further detail.
In the present case, it is assumed that shading-correction data comprises one bit for one pixel. In the vicinity of the first bit (the first pixel) in the output of the CCD sensor 2 shown in FIG. 8 during the prescanning operation, correction data comprises consecutive 1's ("high" s) because of the leading edge of a white-background video signal, so that the analog switch 46 shown in FIG. 9 is closed and the shading capacitor 52 is charged. At that time, charging is performed with a time constant T which is obtained by multiplying the resistance value of the charging resistor 45 by the capacitor value of the shading capacitor 52. Hence, as shown in FIG. 12, the actual reference signal (2) rises slower than the white-background video signal (1), and is therefore greatly degraded in the vicinity of the leading edge. After the actual reference signal (2) has followed and coincided with the white-background video signal (1), a reference signal, which substantially approximates the white-background video signal (1), can be obtained by repeating charging/discharging of the capacitor 52 in accordance with 1 (high) or 0 (low) of correction data for each pixel (each bit).
However, as shown in FIG. 13, when reproducing the reference waveform (shading waveform) while the original is read, using shading-correction data obtained by the above-described prescanning operation, a reference signal (2) having a slow leading edge is reproduced as in the above-described case. Accordingly, when an original-reading video signal (1) is input, the original-reading video signal (1) is greater than the actual reference signal (2) at an interval d, thereby causing overflow errors at a binary-coding processing by the A/D converter 16 shown in FIG. 8. Hence, exact binary-coding processing cannot be performed for the reference signal.
As a result, in the case of a halftone mode in which relative gradation is expressed for the reference signal, exact gradation expression cannot be performed at all, and a white portion is produced in the obtained image.
Even in a binary mode, if a black portion represented by "c" in FIG. 13 is present, the 60-% slice level of the reference signal (2) becomes as indicated by a binary-value slice level (3). Hence, the portion "c" is not estimated as a black portion, but as a white portion, thereby causing missing information.
In the present case, the reading sensor shown in FIG. 8 comprises a CCD sensor. When the original-reading width of the CCD sensor 2 is much larger than that of the apparatus, error information can be abandoned by making the portion d shown in FIG. 13 to be outside the effective reading range of the apparatus. However, as in the case of a contact sensor (CS), when the reading width of the apparatus substantially equals that of the sensor, an error as indicated by c in FIG. 13 is produced in the vicinity of the first bit of reading information, thereby causing serious problems, such as degradation of the quality of the obtained image, and missing of information.